
#include "cocos-ext.h"

#include "Common/Exd/EXData.h"
#include "StageScene.h"
#include "Jumper.h"
#include "MainGameLayer.h"
#include "MainUILayer.h"

USING_NS_CC;

StageScene::StageScene(int _level, bool bPortrait)
{
    CCScene::init();
	level = _level;
}

void StageScene::onEnter()
{
    CCScene::onEnter();

	// 'layer' is an autorelease object
	gameLayer = MainGameLayer::create(this,level);
	// add layer as a child to scene
	addChild(gameLayer);

	uiLayer = MainUILayer::create(gameLayer->forbidColor,gameLayer->forbidShap,gameLayer->forbidNum,gameLayer->jumper->hp);

	addChild(uiLayer);

}

// The CallBack for back to the main menu scene
void StageScene::MainMenuCallback(CCObject* pSender)
{
}



void StageScene::onHpChange(int hp)
{
	uiLayer->ChangeHp(hp);
}


void StageScene::onPointChange(int point)
{
	uiLayer->ChangePoint(point);
}


